package com.wxm.mqttintegrationdoc.mqtt;

import com.wxm.mqttintegrationdoc.protocol.User;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

/*
 * Author:  ALMing
 * Date:    2021/5/5
 * Desc:    Mqtt消息发送器
 */
@Component
@MessagingGateway(defaultRequestChannel = "mqttOutboundChannel")
public interface MqttSender {

//    void sendToMqtt(String msg);
//
//    void sendWithTopic(@Header(MqttHeaders.TOPIC) String topic, String user);

    void sendToMqtt(User user);

    void sendWithTopic(@Header(MqttHeaders.TOPIC) String topic, User user);

    void sendWithTopicAndQos(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) Integer Qos, User user);
}
